﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AutoItX3Lib;

namespace Pokerist
{
    public partial class DoubleClick : Form
    {
        AutoItX3 autoit = new AutoItX3();

        public DoubleClick()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            timer1.Start();
            button2.Enabled = true;
            button1.Enabled = false;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            var a = autoit.ControlGetPosX(textBox3.Text, "", textBox4.Text);

            autoit.ControlClick(textBox3.Text, "", textBox4.Text, "LEFT", 1, Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox2.Text));
        }

        private void DoubleClick_FormClosing(object sender, FormClosingEventArgs e)
        {
            autoit = null;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            timer1.Stop();
            button2.Enabled = false;
            button1.Enabled = true;
        }

        private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            this.Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
        }
    }
}
